package com.nd.android.musicboxlibrary.util.fastDateUtil;

import java.util.Calendar;

/**
 * <p>
 * Inner class to output a constant single character.
 * </p>
 */
public class CharacterLiteral implements Rule {
    private final char mValue;

    /**
     * Constructs a new instance of <code>CharacterLiteral</code> to hold the specified value.
     * 
     * @param value
     *            the character literal
     */
    public CharacterLiteral(char value) {
        mValue = value;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int estimateLength() {
        return 1;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void appendTo(StringBuffer buffer, Calendar calendar) {
        buffer.append(mValue);
    }
}
